import os
t=input('输入日')
time='2020-01-'+t
txt=''
txt2=''
count_sb = {'小非非': 0,'Ray': 0,'桃花换酒钱': 0}
count_sm = {'小非非': 0,'Ray': 0,'桃花换酒钱': 0}
count_bt = {'小非非': 0,'Ray': 0,'桃花换酒钱': 0}
count_jn = 0
with open('2020-01-05_07-31-47.log',encoding='utf-8') as fo:
	for line in fo:
		if time in line:
			line = line.replace('/n','')
			line = line.replace('Handlers: INFO','')
			line = line.replace('hock: INFO','')
			line = line.replace('2020-01-','')
			line = line.replace(' INFO:','')
			if 'executed: /spawnboss' in line or 'executed: /sb' in line:
				print(line)
				txt += line
				if '小非非' in line:
					count_sb['小非非'] += 1
				elif '桃花换酒钱' in line:
					count_sb['桃花换酒钱'] += 1
				elif 'Ray' in line:
					count_sb['Ray'] += 1
			elif 'executed: /spawnmob' in line or 'executed: /sm' in line:
				print(line)
				txt += line
				if '小非非' in line:
					count_sm['小非非'] += 1
				elif '桃花换酒钱' in line:
					count_sm['桃花换酒钱'] += 1
				elif 'Ray' in line:
					count_sm['Ray'] += 1
			elif 'executed: /butcher' in line:
				print(line)
				txt += line
				if '小非非' in line:
					count_bt['小非非'] += 1
				elif '桃花换酒钱' in line:
					count_bt['桃花换酒钱'] += 1
				elif 'Ray' in line:
					count_bt['Ray'] += 1
			elif 'group joined' in line:
				print(line)
				txt2 += line
				count_jn += 1
print('spawnboss次数：'+str(count_sb))
print('spawnmob次数：'+str(count_sm))
print('butcher次数：'+str(count_bt))

with open('详细信息.txt','w',encoding='utf-8') as f2:
	for line in txt:
		f2.write(str(line))
	for line in txt2:
		f2.write(str(line))

os.system("pause")